package cn.edu.cug.cs.gtl.plugins.redner4oi.canvas;

import cn.edu.cug.cs.gtl.apis.render.canvas.RenderArea;

public class RenderAreaImpl  implements RenderArea {
    protected com.openinventor.inventor.viewercomponents.awt.glcanvas.renderareas.RenderArea nativeObject;
    public RenderAreaImpl() {
        super();
        this.nativeObject =   new com.openinventor.inventor.viewercomponents.awt.glcanvas.renderareas.RenderArea();
    }
    @Override
    public Object getNativeObject() {
        return nativeObject;
    }

    @Override
    public boolean attach(Object nativeObject) {
        if(nativeObject==null)
            return false;
        if (nativeObject instanceof com.openinventor.inventor.viewercomponents.awt.glcanvas.renderareas.RenderArea)
            this.nativeObject = (com.openinventor.inventor.viewercomponents.awt.glcanvas.renderareas.RenderArea) nativeObject;
        else
            return false;
        return true;
    }

    @Override
    public Object detach() {
        com.openinventor.inventor.viewercomponents.awt.glcanvas.renderareas.RenderArea r = nativeObject;
        nativeObject = null;
        return r;
    }
}
